import pose_recognition as pr
from Celery_app import celery
from celery import Celery
celery = Celery('tasks', broker='redis://localhost:6379/0')


@celery.task
def startcode(videoInput, sideInput, heightInput):
    video_path = videoInput  # 替换为你的视频路径
    side = sideInput
    height_real = heightInput
    detector = pr.PoseDetector(video_path,height_real,side)
    # 启动动画
    success = detector.start_animation()
    if success is None:
        return None
    return None


# @celery.task
def startcode_two(videoInput, sideInput, heightInput):
    video_path = videoInput  # 替换为你的视频路径
    side = sideInput
    height_real = heightInput


    detector = pr.PoseDetector1(video_path,height_real,side)
    # 启动动画
    detector.start_animation()
    return None


def main():
    # video_path = '1.png'
    video_path = 'video\\222.mp4'
    side = int(input("人物位置"))
    height_real = int(input("身高"))

    detector = pr.PoseDetector1(video_path,height_real,side)
    detector.start_animation()
    return None

if __name__ == '__main__':
    main()
